﻿namespace HRM.CORE
{

    using APP.HELPER.Data.Helper;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;

    public class HRM_TRAINING
    {
        private string m_Certificate;
        private DateTime m_DecideDate;
        private string m_DecideNumber;
        private string m_DecidePerson;
        private string m_Description;
        private string m_Form;
        private string m_Location;
        private decimal m_MoneyAllCompany;
        private decimal m_MoneyAllEmployee;
        private decimal m_MoneyAllTotal;
        private decimal m_MoneyOneCompany;
        private decimal m_MoneyOneEmployee;
        private decimal m_MoneyOneTotal;
        private decimal m_MoneyTotal;
        private string m_PartnerAddress;
        private string m_PartnerEmail;
        private string m_PartnerFax;
        private string m_PartnerName;
        private string m_PartnerPhone;
        private string m_PartnerWebsite;
        private DateTime m_PerformFromDate;
        private DateTime m_PerformToDate;
        private string m_PersonAddress;
        private string m_PersonEmail;
        private string m_PersonName;
        private string m_PersonPhone;
        private string m_PersonPosition;
        private DateTime m_PrepareFromDate;
        private DateTime m_PrepareToDate;
        private string m_Purpose;
        private int m_Quantity;
        private DateTime m_RegisterFromDate;
        private DateTime m_RegisterToDate;
        private int m_Status;
        private string m_TrainingCode;
        private string m_TrainingName;

        public HRM_TRAINING()
        {
            this.m_TrainingCode = "";
            this.m_TrainingName = "";
            this.m_Description = "";
            this.m_Purpose = "";
            this.m_Form = "";
            this.m_Location = "";
            this.m_Certificate = "";
            this.m_Quantity = 0;
            this.m_MoneyOneEmployee = 0M;
            this.m_MoneyOneCompany = 0M;
            this.m_MoneyOneTotal = 0M;
            this.m_MoneyAllEmployee = 0M;
            this.m_MoneyAllCompany = 0M;
            this.m_MoneyAllTotal = 0M;
            this.m_MoneyTotal = 0M;
            this.m_PrepareFromDate = DateTime.Now;
            this.m_PrepareToDate = DateTime.Now;
            this.m_RegisterFromDate = DateTime.Now;
            this.m_RegisterToDate = DateTime.Now;
            this.m_PerformFromDate = DateTime.Now;
            this.m_PerformToDate = DateTime.Now;
            this.m_DecideNumber = "";
            this.m_DecideDate = DateTime.Now;
            this.m_DecidePerson = "";
            this.m_PartnerName = "";
            this.m_PartnerAddress = "";
            this.m_PartnerPhone = "";
            this.m_PartnerFax = "";
            this.m_PartnerWebsite = "";
            this.m_PartnerEmail = "";
            this.m_PersonName = "";
            this.m_PersonPhone = "";
            this.m_PersonPosition = "";
            this.m_PersonAddress = "";
            this.m_PersonEmail = "";
            this.m_Status = 0;
        }

        public HRM_TRAINING(string TrainingCode, string TrainingName, string Description, string Purpose, string Form, string Location, string Certificate, int Quantity, decimal MoneyOneEmployee, decimal MoneyOneCompany, decimal MoneyOneTotal, decimal MoneyAllEmployee, decimal MoneyAllCompany, decimal MoneyAllTotal, decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, string DecideNumber, DateTime DecideDate, string DecidePerson, string PartnerName, string PartnerAddress, string PartnerPhone, string PartnerFax, string PartnerWebsite, string PartnerEmail, string PersonName, string PersonPhone, string PersonPosition, string PersonAddress, string PersonEmail, int Status)
        {
            this.m_TrainingCode = TrainingCode;
            this.m_TrainingName = TrainingName;
            this.m_Description = Description;
            this.m_Purpose = Purpose;
            this.m_Form = Form;
            this.m_Location = Location;
            this.m_Certificate = Certificate;
            this.m_Quantity = Quantity;
            this.m_MoneyOneEmployee = MoneyOneEmployee;
            this.m_MoneyOneCompany = MoneyOneCompany;
            this.m_MoneyOneTotal = MoneyOneTotal;
            this.m_MoneyAllEmployee = MoneyAllEmployee;
            this.m_MoneyAllCompany = MoneyAllCompany;
            this.m_MoneyAllTotal = MoneyAllTotal;
            this.m_MoneyTotal = MoneyTotal;
            this.m_PrepareFromDate = PrepareFromDate;
            this.m_PrepareToDate = PrepareToDate;
            this.m_RegisterFromDate = RegisterFromDate;
            this.m_RegisterToDate = RegisterToDate;
            this.m_PerformFromDate = PerformFromDate;
            this.m_PerformToDate = PerformToDate;
            this.m_DecideNumber = DecideNumber;
            this.m_DecideDate = DecideDate;
            this.m_DecidePerson = DecidePerson;
            this.m_PartnerName = PartnerName;
            this.m_PartnerAddress = PartnerAddress;
            this.m_PartnerPhone = PartnerPhone;
            this.m_PartnerFax = PartnerFax;
            this.m_PartnerWebsite = PartnerWebsite;
            this.m_PartnerEmail = PartnerEmail;
            this.m_PersonName = PersonName;
            this.m_PersonPhone = PersonPhone;
            this.m_PersonPosition = PersonPosition;
            this.m_PersonAddress = PersonAddress;
            this.m_PersonEmail = PersonEmail;
            this.m_Status = Status;
        }

        public string Delete()
        {
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { this.m_TrainingCode };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_TRAINING_Delete", myParams, myValues);
        }

        public string Delete(string TrainingCode)
        {
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { TrainingCode };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_TRAINING_Delete", myParams, myValues);
        }

        public string Delete(SqlConnection myConnection, string TrainingCode)
        {
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { TrainingCode };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_TRAINING_Delete", myParams, myValues);
        }

        public string Delete(SqlTransaction myTransaction, string TrainingCode)
        {
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { TrainingCode };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_TRAINING_Delete", myParams, myValues);
        }

        public bool Exist(string TrainingCode)
        {
            bool hasRows = false;
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { TrainingCode };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_TRAINING_Get", myParams, myValues);
            if (reader != null)
            {
                hasRows = reader.HasRows;
                reader.Close();
                helper.Close();
                reader = null;
            }
            return hasRows;
        }

        public string Get(string TrainingCode)
        {
            string str = "";
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { TrainingCode };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_TRAINING_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_TrainingCode = Convert.ToString(reader["TrainingCode"]);
                    this.m_TrainingName = Convert.ToString(reader["TrainingName"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    this.m_Purpose = Convert.ToString(reader["Purpose"]);
                    this.m_Form = Convert.ToString(reader["Form"]);
                    this.m_Location = Convert.ToString(reader["Location"]);
                    this.m_Certificate = Convert.ToString(reader["Certificate"]);
                    this.m_Quantity = Convert.ToInt32(reader["Quantity"]);
                    this.m_MoneyOneEmployee = Convert.ToDecimal(reader["MoneyOneEmployee"]);
                    this.m_MoneyOneCompany = Convert.ToDecimal(reader["MoneyOneCompany"]);
                    this.m_MoneyOneTotal = Convert.ToDecimal(reader["MoneyOneTotal"]);
                    this.m_MoneyAllEmployee = Convert.ToDecimal(reader["MoneyAllEmployee"]);
                    this.m_MoneyAllCompany = Convert.ToDecimal(reader["MoneyAllCompany"]);
                    this.m_MoneyAllTotal = Convert.ToDecimal(reader["MoneyAllTotal"]);
                    this.m_MoneyTotal = Convert.ToDecimal(reader["MoneyTotal"]);
                    this.m_PrepareFromDate = Convert.ToDateTime(reader["PrepareFromDate"]);
                    this.m_PrepareToDate = Convert.ToDateTime(reader["PrepareToDate"]);
                    this.m_RegisterFromDate = Convert.ToDateTime(reader["RegisterFromDate"]);
                    this.m_RegisterToDate = Convert.ToDateTime(reader["RegisterToDate"]);
                    this.m_PerformFromDate = Convert.ToDateTime(reader["PerformFromDate"]);
                    this.m_PerformToDate = Convert.ToDateTime(reader["PerformToDate"]);
                    this.m_DecideNumber = Convert.ToString(reader["DecideNumber"]);
                    this.m_DecideDate = Convert.ToDateTime(reader["DecideDate"]);
                    this.m_DecidePerson = Convert.ToString(reader["DecidePerson"]);
                    this.m_PartnerName = Convert.ToString(reader["PartnerName"]);
                    this.m_PartnerAddress = Convert.ToString(reader["PartnerAddress"]);
                    this.m_PartnerPhone = Convert.ToString(reader["PartnerPhone"]);
                    this.m_PartnerFax = Convert.ToString(reader["PartnerFax"]);
                    this.m_PartnerWebsite = Convert.ToString(reader["PartnerWebsite"]);
                    this.m_PartnerEmail = Convert.ToString(reader["PartnerEmail"]);
                    this.m_PersonName = Convert.ToString(reader["PersonName"]);
                    this.m_PersonPhone = Convert.ToString(reader["PersonPhone"]);
                    this.m_PersonPosition = Convert.ToString(reader["PersonPosition"]);
                    this.m_PersonAddress = Convert.ToString(reader["PersonAddress"]);
                    this.m_PersonEmail = Convert.ToString(reader["PersonEmail"]);
                    this.m_Status = Convert.ToInt32(reader["Status"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlConnection myConnection, string TrainingCode)
        {
            string str = "";
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { TrainingCode };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myConnection, "HRM_TRAINING_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_TrainingCode = Convert.ToString(reader["TrainingCode"]);
                    this.m_TrainingName = Convert.ToString(reader["TrainingName"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    this.m_Purpose = Convert.ToString(reader["Purpose"]);
                    this.m_Form = Convert.ToString(reader["Form"]);
                    this.m_Location = Convert.ToString(reader["Location"]);
                    this.m_Certificate = Convert.ToString(reader["Certificate"]);
                    this.m_Quantity = Convert.ToInt32(reader["Quantity"]);
                    this.m_MoneyOneEmployee = Convert.ToDecimal(reader["MoneyOneEmployee"]);
                    this.m_MoneyOneCompany = Convert.ToDecimal(reader["MoneyOneCompany"]);
                    this.m_MoneyOneTotal = Convert.ToDecimal(reader["MoneyOneTotal"]);
                    this.m_MoneyAllEmployee = Convert.ToDecimal(reader["MoneyAllEmployee"]);
                    this.m_MoneyAllCompany = Convert.ToDecimal(reader["MoneyAllCompany"]);
                    this.m_MoneyAllTotal = Convert.ToDecimal(reader["MoneyAllTotal"]);
                    this.m_MoneyTotal = Convert.ToDecimal(reader["MoneyTotal"]);
                    this.m_PrepareFromDate = Convert.ToDateTime(reader["PrepareFromDate"]);
                    this.m_PrepareToDate = Convert.ToDateTime(reader["PrepareToDate"]);
                    this.m_RegisterFromDate = Convert.ToDateTime(reader["RegisterFromDate"]);
                    this.m_RegisterToDate = Convert.ToDateTime(reader["RegisterToDate"]);
                    this.m_PerformFromDate = Convert.ToDateTime(reader["PerformFromDate"]);
                    this.m_PerformToDate = Convert.ToDateTime(reader["PerformToDate"]);
                    this.m_DecideNumber = Convert.ToString(reader["DecideNumber"]);
                    this.m_DecideDate = Convert.ToDateTime(reader["DecideDate"]);
                    this.m_DecidePerson = Convert.ToString(reader["DecidePerson"]);
                    this.m_PartnerName = Convert.ToString(reader["PartnerName"]);
                    this.m_PartnerAddress = Convert.ToString(reader["PartnerAddress"]);
                    this.m_PartnerPhone = Convert.ToString(reader["PartnerPhone"]);
                    this.m_PartnerFax = Convert.ToString(reader["PartnerFax"]);
                    this.m_PartnerWebsite = Convert.ToString(reader["PartnerWebsite"]);
                    this.m_PartnerEmail = Convert.ToString(reader["PartnerEmail"]);
                    this.m_PersonName = Convert.ToString(reader["PersonName"]);
                    this.m_PersonPhone = Convert.ToString(reader["PersonPhone"]);
                    this.m_PersonPosition = Convert.ToString(reader["PersonPosition"]);
                    this.m_PersonAddress = Convert.ToString(reader["PersonAddress"]);
                    this.m_PersonEmail = Convert.ToString(reader["PersonEmail"]);
                    this.m_Status = Convert.ToInt32(reader["Status"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlTransaction myTransaction, string TrainingCode)
        {
            string str = "";
            string[] myParams = new string[] { "@TrainingCode" };
            object[] myValues = new object[] { TrainingCode };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myTransaction, "HRM_TRAINING_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_TrainingCode = Convert.ToString(reader["TrainingCode"]);
                    this.m_TrainingName = Convert.ToString(reader["TrainingName"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    this.m_Purpose = Convert.ToString(reader["Purpose"]);
                    this.m_Form = Convert.ToString(reader["Form"]);
                    this.m_Location = Convert.ToString(reader["Location"]);
                    this.m_Certificate = Convert.ToString(reader["Certificate"]);
                    this.m_Quantity = Convert.ToInt32(reader["Quantity"]);
                    this.m_MoneyOneEmployee = Convert.ToDecimal(reader["MoneyOneEmployee"]);
                    this.m_MoneyOneCompany = Convert.ToDecimal(reader["MoneyOneCompany"]);
                    this.m_MoneyOneTotal = Convert.ToDecimal(reader["MoneyOneTotal"]);
                    this.m_MoneyAllEmployee = Convert.ToDecimal(reader["MoneyAllEmployee"]);
                    this.m_MoneyAllCompany = Convert.ToDecimal(reader["MoneyAllCompany"]);
                    this.m_MoneyAllTotal = Convert.ToDecimal(reader["MoneyAllTotal"]);
                    this.m_MoneyTotal = Convert.ToDecimal(reader["MoneyTotal"]);
                    this.m_PrepareFromDate = Convert.ToDateTime(reader["PrepareFromDate"]);
                    this.m_PrepareToDate = Convert.ToDateTime(reader["PrepareToDate"]);
                    this.m_RegisterFromDate = Convert.ToDateTime(reader["RegisterFromDate"]);
                    this.m_RegisterToDate = Convert.ToDateTime(reader["RegisterToDate"]);
                    this.m_PerformFromDate = Convert.ToDateTime(reader["PerformFromDate"]);
                    this.m_PerformToDate = Convert.ToDateTime(reader["PerformToDate"]);
                    this.m_DecideNumber = Convert.ToString(reader["DecideNumber"]);
                    this.m_DecideDate = Convert.ToDateTime(reader["DecideDate"]);
                    this.m_DecidePerson = Convert.ToString(reader["DecidePerson"]);
                    this.m_PartnerName = Convert.ToString(reader["PartnerName"]);
                    this.m_PartnerAddress = Convert.ToString(reader["PartnerAddress"]);
                    this.m_PartnerPhone = Convert.ToString(reader["PartnerPhone"]);
                    this.m_PartnerFax = Convert.ToString(reader["PartnerFax"]);
                    this.m_PartnerWebsite = Convert.ToString(reader["PartnerWebsite"]);
                    this.m_PartnerEmail = Convert.ToString(reader["PartnerEmail"]);
                    this.m_PersonName = Convert.ToString(reader["PersonName"]);
                    this.m_PersonPhone = Convert.ToString(reader["PersonPhone"]);
                    this.m_PersonPosition = Convert.ToString(reader["PersonPosition"]);
                    this.m_PersonAddress = Convert.ToString(reader["PersonAddress"]);
                    this.m_PersonEmail = Convert.ToString(reader["PersonEmail"]);
                    this.m_Status = Convert.ToInt32(reader["Status"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public DataTable GetList()
        {
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_TRAINING_GetList");
        }

        public DataTable GetListByDate(DateTime BeginDate, DateTime EndDate)
        {
            string[] myParams = new string[] { "@BeginDate", "@EndDate" };
            object[] myValues = new object[] { BeginDate, EndDate };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_TRAINING_GetListByDate", myParams, myValues);
        }

        public string Insert()
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                this.m_TrainingCode, this.m_TrainingName, this.m_Description, this.m_Purpose, this.m_Form, this.m_Location, this.m_Certificate, this.m_Quantity, this.m_MoneyOneEmployee, this.m_MoneyOneCompany, this.m_MoneyOneTotal, this.m_MoneyAllEmployee, this.m_MoneyAllCompany, this.m_MoneyAllTotal, this.m_MoneyTotal, this.m_PrepareFromDate, 
                this.m_PrepareToDate, this.m_RegisterFromDate, this.m_RegisterToDate, this.m_PerformFromDate, this.m_PerformToDate, this.m_DecideNumber, this.m_DecideDate, this.m_DecidePerson, this.m_PartnerName, this.m_PartnerAddress, this.m_PartnerPhone, this.m_PartnerFax, this.m_PartnerWebsite, this.m_PartnerEmail, this.m_PersonName, this.m_PersonPhone, 
                this.m_PersonPosition, this.m_PersonAddress, this.m_PersonEmail, this.m_Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_TRAINING_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction)
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                this.m_TrainingCode, this.m_TrainingName, this.m_Description, this.m_Purpose, this.m_Form, this.m_Location, this.m_Certificate, this.m_Quantity, this.m_MoneyOneEmployee, this.m_MoneyOneCompany, this.m_MoneyOneTotal, this.m_MoneyAllEmployee, this.m_MoneyAllCompany, this.m_MoneyAllTotal, this.m_MoneyTotal, this.m_PrepareFromDate, 
                this.m_PrepareToDate, this.m_RegisterFromDate, this.m_RegisterToDate, this.m_PerformFromDate, this.m_PerformToDate, this.m_DecideNumber, this.m_DecideDate, this.m_DecidePerson, this.m_PartnerName, this.m_PartnerAddress, this.m_PartnerPhone, this.m_PartnerFax, this.m_PartnerWebsite, this.m_PartnerEmail, this.m_PersonName, this.m_PersonPhone, 
                this.m_PersonPosition, this.m_PersonAddress, this.m_PersonEmail, this.m_Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_TRAINING_Insert", myParams, myValues);
        }

        public string Insert(string TrainingCode, string TrainingName, string Description, string Purpose, string Form, string Location, string Certificate, int Quantity, decimal MoneyOneEmployee, decimal MoneyOneCompany, decimal MoneyOneTotal, decimal MoneyAllEmployee, decimal MoneyAllCompany, decimal MoneyAllTotal, decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, string DecideNumber, DateTime DecideDate, string DecidePerson, string PartnerName, string PartnerAddress, string PartnerPhone, string PartnerFax, string PartnerWebsite, string PartnerEmail, string PersonName, string PersonPhone, string PersonPosition, string PersonAddress, string PersonEmail, int Status)
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                TrainingCode, TrainingName, Description, Purpose, Form, Location, Certificate, Quantity, MoneyOneEmployee, MoneyOneCompany, MoneyOneTotal, MoneyAllEmployee, MoneyAllCompany, MoneyAllTotal, MoneyTotal, PrepareFromDate, 
                PrepareToDate, RegisterFromDate, RegisterToDate, PerformFromDate, PerformToDate, DecideNumber, DecideDate, DecidePerson, PartnerName, PartnerAddress, PartnerPhone, PartnerFax, PartnerWebsite, PartnerEmail, PersonName, PersonPhone, 
                PersonPosition, PersonAddress, PersonEmail, Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_TRAINING_Insert", myParams, myValues);
        }

        public string Insert(SqlConnection myConnection, string TrainingCode, string TrainingName, string Description, string Purpose, string Form, string Location, string Certificate, int Quantity, decimal MoneyOneEmployee, decimal MoneyOneCompany, decimal MoneyOneTotal, decimal MoneyAllEmployee, decimal MoneyAllCompany, decimal MoneyAllTotal, decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, string DecideNumber, DateTime DecideDate, string DecidePerson, string PartnerName, string PartnerAddress, string PartnerPhone, string PartnerFax, string PartnerWebsite, string PartnerEmail, string PersonName, string PersonPhone, string PersonPosition, string PersonAddress, string PersonEmail, int Status)
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                TrainingCode, TrainingName, Description, Purpose, Form, Location, Certificate, Quantity, MoneyOneEmployee, MoneyOneCompany, MoneyOneTotal, MoneyAllEmployee, MoneyAllCompany, MoneyAllTotal, MoneyTotal, PrepareFromDate, 
                PrepareToDate, RegisterFromDate, RegisterToDate, PerformFromDate, PerformToDate, DecideNumber, DecideDate, DecidePerson, PartnerName, PartnerAddress, PartnerPhone, PartnerFax, PartnerWebsite, PartnerEmail, PersonName, PersonPhone, 
                PersonPosition, PersonAddress, PersonEmail, Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_TRAINING_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction, string TrainingCode, string TrainingName, string Description, string Purpose, string Form, string Location, string Certificate, int Quantity, decimal MoneyOneEmployee, decimal MoneyOneCompany, decimal MoneyOneTotal, decimal MoneyAllEmployee, decimal MoneyAllCompany, decimal MoneyAllTotal, decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, string DecideNumber, DateTime DecideDate, string DecidePerson, string PartnerName, string PartnerAddress, string PartnerPhone, string PartnerFax, string PartnerWebsite, string PartnerEmail, string PersonName, string PersonPhone, string PersonPosition, string PersonAddress, string PersonEmail, int Status)
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                TrainingCode, TrainingName, Description, Purpose, Form, Location, Certificate, Quantity, MoneyOneEmployee, MoneyOneCompany, MoneyOneTotal, MoneyAllEmployee, MoneyAllCompany, MoneyAllTotal, MoneyTotal, PrepareFromDate, 
                PrepareToDate, RegisterFromDate, RegisterToDate, PerformFromDate, PerformToDate, DecideNumber, DecideDate, DecidePerson, PartnerName, PartnerAddress, PartnerPhone, PartnerFax, PartnerWebsite, PartnerEmail, PersonName, PersonPhone, 
                PersonPosition, PersonAddress, PersonEmail, Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_TRAINING_Insert", myParams, myValues);
        }

        public string NewID()
        {
            return SqlHelper.GenCode("HRM_TRAINING", "TrainingCode", "KT");
        }

        public string Update()
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                this.m_TrainingCode, this.m_TrainingName, this.m_Description, this.m_Purpose, this.m_Form, this.m_Location, this.m_Certificate, this.m_Quantity, this.m_MoneyOneEmployee, this.m_MoneyOneCompany, this.m_MoneyOneTotal, this.m_MoneyAllEmployee, this.m_MoneyAllCompany, this.m_MoneyAllTotal, this.m_MoneyTotal, this.m_PrepareFromDate, 
                this.m_PrepareToDate, this.m_RegisterFromDate, this.m_RegisterToDate, this.m_PerformFromDate, this.m_PerformToDate, this.m_DecideNumber, this.m_DecideDate, this.m_DecidePerson, this.m_PartnerName, this.m_PartnerAddress, this.m_PartnerPhone, this.m_PartnerFax, this.m_PartnerWebsite, this.m_PartnerEmail, this.m_PersonName, this.m_PersonPhone, 
                this.m_PersonPosition, this.m_PersonAddress, this.m_PersonEmail, this.m_Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_TRAINING_Update", myParams, myValues);
        }

        public string Update(string TrainingCode, string TrainingName, string Description, string Purpose, string Form, string Location, string Certificate, int Quantity, decimal MoneyOneEmployee, decimal MoneyOneCompany, decimal MoneyOneTotal, decimal MoneyAllEmployee, decimal MoneyAllCompany, decimal MoneyAllTotal, decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, string DecideNumber, DateTime DecideDate, string DecidePerson, string PartnerName, string PartnerAddress, string PartnerPhone, string PartnerFax, string PartnerWebsite, string PartnerEmail, string PersonName, string PersonPhone, string PersonPosition, string PersonAddress, string PersonEmail, int Status)
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                TrainingCode, TrainingName, Description, Purpose, Form, Location, Certificate, Quantity, MoneyOneEmployee, MoneyOneCompany, MoneyOneTotal, MoneyAllEmployee, MoneyAllCompany, MoneyAllTotal, MoneyTotal, PrepareFromDate, 
                PrepareToDate, RegisterFromDate, RegisterToDate, PerformFromDate, PerformToDate, DecideNumber, DecideDate, DecidePerson, PartnerName, PartnerAddress, PartnerPhone, PartnerFax, PartnerWebsite, PartnerEmail, PersonName, PersonPhone, 
                PersonPosition, PersonAddress, PersonEmail, Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_TRAINING_Update", myParams, myValues);
        }

        public string Update(SqlConnection myConnection, string TrainingCode, string TrainingName, string Description, string Purpose, string Form, string Location, string Certificate, int Quantity, decimal MoneyOneEmployee, decimal MoneyOneCompany, decimal MoneyOneTotal, decimal MoneyAllEmployee, decimal MoneyAllCompany, decimal MoneyAllTotal, decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, string DecideNumber, DateTime DecideDate, string DecidePerson, string PartnerName, string PartnerAddress, string PartnerPhone, string PartnerFax, string PartnerWebsite, string PartnerEmail, string PersonName, string PersonPhone, string PersonPosition, string PersonAddress, string PersonEmail, int Status)
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                TrainingCode, TrainingName, Description, Purpose, Form, Location, Certificate, Quantity, MoneyOneEmployee, MoneyOneCompany, MoneyOneTotal, MoneyAllEmployee, MoneyAllCompany, MoneyAllTotal, MoneyTotal, PrepareFromDate, 
                PrepareToDate, RegisterFromDate, RegisterToDate, PerformFromDate, PerformToDate, DecideNumber, DecideDate, DecidePerson, PartnerName, PartnerAddress, PartnerPhone, PartnerFax, PartnerWebsite, PartnerEmail, PersonName, PersonPhone, 
                PersonPosition, PersonAddress, PersonEmail, Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_TRAINING_Update", myParams, myValues);
        }

        public string Update(SqlTransaction myTransaction, string TrainingCode, string TrainingName, string Description, string Purpose, string Form, string Location, string Certificate, int Quantity, decimal MoneyOneEmployee, decimal MoneyOneCompany, decimal MoneyOneTotal, decimal MoneyAllEmployee, decimal MoneyAllCompany, decimal MoneyAllTotal, decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, string DecideNumber, DateTime DecideDate, string DecidePerson, string PartnerName, string PartnerAddress, string PartnerPhone, string PartnerFax, string PartnerWebsite, string PartnerEmail, string PersonName, string PersonPhone, string PersonPosition, string PersonAddress, string PersonEmail, int Status)
        {
            string[] myParams = new string[] { 
                "@TrainingCode", "@TrainingName", "@Description", "@Purpose", "@Form", "@Location", "@Certificate", "@Quantity", "@MoneyOneEmployee", "@MoneyOneCompany", "@MoneyOneTotal", "@MoneyAllEmployee", "@MoneyAllCompany", "@MoneyAllTotal", "@MoneyTotal", "@PrepareFromDate", 
                "@PrepareToDate", "@RegisterFromDate", "@RegisterToDate", "@PerformFromDate", "@PerformToDate", "@DecideNumber", "@DecideDate", "@DecidePerson", "@PartnerName", "@PartnerAddress", "@PartnerPhone", "@PartnerFax", "@PartnerWebsite", "@PartnerEmail", "@PersonName", "@PersonPhone", 
                "@PersonPosition", "@PersonAddress", "@PersonEmail", "@Status"
             };
            object[] myValues = new object[] { 
                TrainingCode, TrainingName, Description, Purpose, Form, Location, Certificate, Quantity, MoneyOneEmployee, MoneyOneCompany, MoneyOneTotal, MoneyAllEmployee, MoneyAllCompany, MoneyAllTotal, MoneyTotal, PrepareFromDate, 
                PrepareToDate, RegisterFromDate, RegisterToDate, PerformFromDate, PerformToDate, DecideNumber, DecideDate, DecidePerson, PartnerName, PartnerAddress, PartnerPhone, PartnerFax, PartnerWebsite, PartnerEmail, PersonName, PersonPhone, 
                PersonPosition, PersonAddress, PersonEmail, Status
             };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_TRAINING_Update", myParams, myValues);
        }

        [Category("Column"), DisplayName("Certificate")]
        public string Certificate
        {
            get
            {
                return this.m_Certificate;
            }
            set
            {
                this.m_Certificate = value;
            }
        }

        [DisplayName("DecideDate"), Category("Column")]
        public DateTime DecideDate
        {
            get
            {
                return this.m_DecideDate;
            }
            set
            {
                this.m_DecideDate = value;
            }
        }

        [DisplayName("DecideNumber"), Category("Column")]
        public string DecideNumber
        {
            get
            {
                return this.m_DecideNumber;
            }
            set
            {
                this.m_DecideNumber = value;
            }
        }

        [DisplayName("DecidePerson"), Category("Column")]
        public string DecidePerson
        {
            get
            {
                return this.m_DecidePerson;
            }
            set
            {
                this.m_DecidePerson = value;
            }
        }

        [DisplayName("Description"), Category("Column")]
        public string Description
        {
            get
            {
                return this.m_Description;
            }
            set
            {
                this.m_Description = value;
            }
        }

        [Category("Column"), DisplayName("Form")]
        public string Form
        {
            get
            {
                return this.m_Form;
            }
            set
            {
                this.m_Form = value;
            }
        }

        [Category("Column"), DisplayName("Location")]
        public string Location
        {
            get
            {
                return this.m_Location;
            }
            set
            {
                this.m_Location = value;
            }
        }

        [DisplayName("MoneyAllCompany"), Category("Column")]
        public decimal MoneyAllCompany
        {
            get
            {
                return this.m_MoneyAllCompany;
            }
            set
            {
                this.m_MoneyAllCompany = value;
            }
        }

        [DisplayName("MoneyAllEmployee"), Category("Column")]
        public decimal MoneyAllEmployee
        {
            get
            {
                return this.m_MoneyAllEmployee;
            }
            set
            {
                this.m_MoneyAllEmployee = value;
            }
        }

        [DisplayName("MoneyAllTotal"), Category("Column")]
        public decimal MoneyAllTotal
        {
            get
            {
                return this.m_MoneyAllTotal;
            }
            set
            {
                this.m_MoneyAllTotal = value;
            }
        }

        [Category("Column"), DisplayName("MoneyOneCompany")]
        public decimal MoneyOneCompany
        {
            get
            {
                return this.m_MoneyOneCompany;
            }
            set
            {
                this.m_MoneyOneCompany = value;
            }
        }

        [DisplayName("MoneyOneEmployee"), Category("Column")]
        public decimal MoneyOneEmployee
        {
            get
            {
                return this.m_MoneyOneEmployee;
            }
            set
            {
                this.m_MoneyOneEmployee = value;
            }
        }

        [DisplayName("MoneyOneTotal"), Category("Column")]
        public decimal MoneyOneTotal
        {
            get
            {
                return this.m_MoneyOneTotal;
            }
            set
            {
                this.m_MoneyOneTotal = value;
            }
        }

        [Category("Column"), DisplayName("MoneyTotal")]
        public decimal MoneyTotal
        {
            get
            {
                return this.m_MoneyTotal;
            }
            set
            {
                this.m_MoneyTotal = value;
            }
        }

        [Category("Column"), DisplayName("PartnerAddress")]
        public string PartnerAddress
        {
            get
            {
                return this.m_PartnerAddress;
            }
            set
            {
                this.m_PartnerAddress = value;
            }
        }

        [DisplayName("PartnerEmail"), Category("Column")]
        public string PartnerEmail
        {
            get
            {
                return this.m_PartnerEmail;
            }
            set
            {
                this.m_PartnerEmail = value;
            }
        }

        [Category("Column"), DisplayName("PartnerFax")]
        public string PartnerFax
        {
            get
            {
                return this.m_PartnerFax;
            }
            set
            {
                this.m_PartnerFax = value;
            }
        }

        [Category("Column"), DisplayName("PartnerName")]
        public string PartnerName
        {
            get
            {
                return this.m_PartnerName;
            }
            set
            {
                this.m_PartnerName = value;
            }
        }

        [DisplayName("PartnerPhone"), Category("Column")]
        public string PartnerPhone
        {
            get
            {
                return this.m_PartnerPhone;
            }
            set
            {
                this.m_PartnerPhone = value;
            }
        }

        [Category("Column"), DisplayName("PartnerWebsite")]
        public string PartnerWebsite
        {
            get
            {
                return this.m_PartnerWebsite;
            }
            set
            {
                this.m_PartnerWebsite = value;
            }
        }

        [Category("Column"), DisplayName("PerformFromDate")]
        public DateTime PerformFromDate
        {
            get
            {
                return this.m_PerformFromDate;
            }
            set
            {
                this.m_PerformFromDate = value;
            }
        }

        [Category("Column"), DisplayName("PerformToDate")]
        public DateTime PerformToDate
        {
            get
            {
                return this.m_PerformToDate;
            }
            set
            {
                this.m_PerformToDate = value;
            }
        }

        [DisplayName("PersonAddress"), Category("Column")]
        public string PersonAddress
        {
            get
            {
                return this.m_PersonAddress;
            }
            set
            {
                this.m_PersonAddress = value;
            }
        }

        [Category("Column"), DisplayName("PersonEmail")]
        public string PersonEmail
        {
            get
            {
                return this.m_PersonEmail;
            }
            set
            {
                this.m_PersonEmail = value;
            }
        }

        [Category("Column"), DisplayName("PersonName")]
        public string PersonName
        {
            get
            {
                return this.m_PersonName;
            }
            set
            {
                this.m_PersonName = value;
            }
        }

        [Category("Column"), DisplayName("PersonPhone")]
        public string PersonPhone
        {
            get
            {
                return this.m_PersonPhone;
            }
            set
            {
                this.m_PersonPhone = value;
            }
        }

        [Category("Column"), DisplayName("PersonPosition")]
        public string PersonPosition
        {
            get
            {
                return this.m_PersonPosition;
            }
            set
            {
                this.m_PersonPosition = value;
            }
        }

        [DisplayName("PrepareFromDate"), Category("Column")]
        public DateTime PrepareFromDate
        {
            get
            {
                return this.m_PrepareFromDate;
            }
            set
            {
                this.m_PrepareFromDate = value;
            }
        }

        [Category("Column"), DisplayName("PrepareToDate")]
        public DateTime PrepareToDate
        {
            get
            {
                return this.m_PrepareToDate;
            }
            set
            {
                this.m_PrepareToDate = value;
            }
        }

        public string ProductName
        {
            get
            {
                return "Class HRM_TRAINING";
            }
        }

        public string ProductVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        [Category("Column"), DisplayName("Purpose")]
        public string Purpose
        {
            get
            {
                return this.m_Purpose;
            }
            set
            {
                this.m_Purpose = value;
            }
        }

        [Category("Column"), DisplayName("Quantity")]
        public int Quantity
        {
            get
            {
                return this.m_Quantity;
            }
            set
            {
                this.m_Quantity = value;
            }
        }

        [DisplayName("RegisterFromDate"), Category("Column")]
        public DateTime RegisterFromDate
        {
            get
            {
                return this.m_RegisterFromDate;
            }
            set
            {
                this.m_RegisterFromDate = value;
            }
        }

        [DisplayName("RegisterToDate"), Category("Column")]
        public DateTime RegisterToDate
        {
            get
            {
                return this.m_RegisterToDate;
            }
            set
            {
                this.m_RegisterToDate = value;
            }
        }

        [DisplayName("Status"), Category("Column")]
        public int Status
        {
            get
            {
                return this.m_Status;
            }
            set
            {
                this.m_Status = value;
            }
        }

        [Category("Primary Key"), DisplayName("TrainingCode")]
        public string TrainingCode
        {
            get
            {
                return this.m_TrainingCode;
            }
            set
            {
                this.m_TrainingCode = value;
            }
        }

        [Category("Column"), DisplayName("TrainingName")]
        public string TrainingName
        {
            get
            {
                return this.m_TrainingName;
            }
            set
            {
                this.m_TrainingName = value;
            }
        }
    }
}

